package day05;
import java.util.Arrays;
import java.util.Random;
public class Homework1 {
    public static void main(String[] args) {
        //1
        for (int num=1;num<=9;num++){
            for(int i=1;i<=num;i++){
                System.out.print(i+"*"+num+"="+num*i+"\t");
            }
            System.out.println();
        }



        //2
        /*
        int[] arr1 = new int[10];
        int[] arr2 = {2,3,4};
        int[] arr3 = new int[]{2,3,4};
        int[] arr4;
        arr4 =new int[]{2,3,4};

        System.out.println(arr1.length);
        System.out.println(arr2[2]);
        System.out.println("-------");

        Random rand = new Random();
        int[] arr = new int[10];
        for (int i=0;i<arr.length;i++){
            arr[i] = rand.nextInt(100);
            System.out.println(arr[i]);
        }
        System.out.println("-------");

        int[] a = {10,20,30,40,50};
        int[] b = new int[6];
        System.arraycopy(a,2,b,0,2);
        for (int i=0;i< b.length;i++){
            System.out.println(b[i]);
        }
        int[] c = {10,20,30,40,50};
        c = Arrays.copyof(c,c.length+1);
        for(int i=0;i<c.length;i++){
            System.out.println(c[i]);
         }
         */
        //3
        /*
        int[] arr = new int[10];
        Random rand = new Random();
        for (int i=0;i< arr.length;i++){
            arr[i] = rand.nextInt(100);
            System.out.println(arr[i]);
        }
        int max = arr[0];
        for (int i=1;i< arr.length;i++){
            if (arr[i]>max){
                max = arr[i];
            }
        }
        System.out.println("最大值为"+max);
        System.out.println("------------");
        arr = Arrays.copyOf(arr,arr.length+1);
        arr[arr.length-1] = max;
        for (int i=0;i<arr.length;i++){
            System.out.println(arr[i]);
        }

         */
        //4
        /*
        int[] arr = new int[10];
        Random rand = new Random();
        for (int i=0;i< arr.length;i++){
            arr[i] = rand.nextInt(100);
            System.out.println(arr[i]);
        }
        System.out.println("--------");
        Arrays.sort(arr);
        for (int i=0; i<arr.length;i++){
            System.out.println(arr[i]);
        }

         */
    }
}
